gtk_widget_queue_resize (priv->widget);
}
-static void
-remove_layout_child (GtkWidget *widget,
- GtkWidget *old_parent,
- GtkLayoutManager *self)
+/*< private >
+ * gtk_layout_manager_remove_layout_child:
+ * @manager: a #GtkLayoutManager
+ * @widget: a #GtkWidget
+ *
+ * Removes the #GtkLayoutChild associated with @widget from the
+ * given #GtkLayoutManager, if any is set.
+ */
+void
+gtk_layout_manager_remove_layout_child (GtkLayoutManager *manager,
+ GtkWidget *widget)
{
- GtkLayoutManagerPrivate *priv = gtk_layout_manager_get_instance_private (self);
+ GtkLayoutManagerPrivate *priv = gtk_layout_manager_get_instance_private (manager);
if (priv->layout_children != NULL)
{
if (g_hash_table_size (priv->layout_children) == 0)
g_clear_pointer (&priv->layout_children, g_hash_table_unref);
}
-
- g_signal_handlers_disconnect_by_func (widget, remove_layout_child, self);
}
/**
g_assert (g_type_is_a (G_OBJECT_TYPE (res), GTK_TYPE_LAYOUT_CHILD));
g_hash_table_insert (priv->layout_children, child, res);
- g_signal_connect (child, "parent-set", G_CALLBACK (remove_layout_child), manager);
return res;
}
if (old_parent->priv->children_observer)
gtk_list_list_model_item_removed (old_parent->priv->children_observer, old_prev_sibling);
+ if (old_parent->priv->layout_manager)
+ gtk_layout_manager_remove_layout_child (old_parent->priv->layout_manager, widget);
+
/* Now that the parent pointer is nullified and the unroot vfunc already
* called, go ahead and unset the parent window, if we are unparenting
* an embedded GtkWindow the window will become toplevel again and root